package com.gong.gongcloudpicture1.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gong.gongcloudpicture1.common.BaseResponse;
import com.gong.gongcloudpicture1.model.dto.picture.PictureQueryRequest;
import com.gong.gongcloudpicture1.model.dto.picture.PictureReviewRequest;
import com.gong.gongcloudpicture1.model.dto.picture.PictureUploadByBatchRequest;
import com.gong.gongcloudpicture1.model.dto.picture.PictureUploadRequest;
import com.gong.gongcloudpicture1.model.entity.picture.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gong.gongcloudpicture1.model.entity.user.User;
import com.gong.gongcloudpicture1.model.vo.picture.PictureVO;
import com.gong.gongcloudpicture1.model.vo.user.UserLoginVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author g1783
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-06-07 21:59:45
*/
public interface PictureService extends IService<Picture> {

    /**
     * 图片校验
     * @param picture
     */
    void validPicture(Picture picture);

    /**
     * 文件夹上传
     * @param inputSource 上传的文件
     * @param pictureUploadRequest
     * @param loginUser 当前登录用户
     * @return
     */
    BaseResponse<PictureVO> uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, User loginUser);



    /**
     * 图片查询体
     * @param pictureQueryRequest
     * @return
     */
    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);


    /**
     * 图片管理分页
     * @param picturePage
     * @return
     */
    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage);

    /**
     * 图片管理分页
     * @param pictureQueryRequest
     * @return
     */
    Page<PictureVO> listPictureVoByPage(PictureQueryRequest pictureQueryRequest);


    /**
     * 获取图片VO
     * @param picture
     * @return
     */
    PictureVO getPictureVO(Picture picture);


    /**
     * 获取图片VO集合
     * @param pictureList
     * @return
     */
    List<PictureVO> getPictureVOList(List<Picture> pictureList);


    /**
     * 图片审核 管理员使用
     * @param pictureReviewRequest
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, HttpServletRequest request);


    /**
     * 填充审核字段
     * @param picture
     * @param user
     */
    void fillReviewStatus(Picture picture, User user);


    /**
     * 批量抓取图片
     * @param pictureUploadByBatchRequest
     * @param loginUser
     * @return 返回成功的数量
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User loginUser);
}
